package com.example.animal;

import java.time.LocalDate;

/**
 * 海马类，继承自鱼类，实现生殖和游泳接口
 * 海马是特殊的鱼类，具有独特的形态和繁殖方式
 */
public class Seahorse extends Fish implements Reproduction, Swimmable {
    /**
     * 构造函数
     * @param name 动物名称
     * @param speciesName 物种名称
     * @param birthDate 出生日期
     * @param color 颜色
     * @param weight 体重
     * @param gender 性别
     * @param temperatureType 体温类型
     * @param breathesWithGills 是否用鳃呼吸
     */
    public Seahorse(String name, String speciesName, LocalDate birthDate, 
                    String color, double weight, Gender gender, TemperatureRegulation temperatureType,
                    boolean breathesWithGills) {
        super(name, speciesName, birthDate, color, weight, gender, temperatureType, breathesWithGills);
    }

    @Override
    public void breathe() {
        if (breathesWithGills) {
            System.out.println(name + " " + speciesName + "用鳃呼吸");
        } else {
            System.out.println(name + " " + speciesName + "用肺呼吸");
        }
    }

    @Override
    public void eat() {
        System.out.println(name + " " + speciesName + "进食");
    }

    @Override
    public void reproduce() {
        System.out.println(name + " " + speciesName + "产卵");
        System.out.println(name + " " + speciesName + "雄性将卵放入育儿袋中孵化");
    }

    @Override
    public void careForYoung() {
        System.out.println(name + " " + speciesName + "雄性负责保护和孵化卵");
        System.out.println(name + " " + speciesName + "幼体在育儿袋中发育完全后出生");
    }

    @Override
    public void swim() {
        System.out.println(name + " " + speciesName + "通过快速摆动背鳍游动");
    }
    
    /**
     * 海马特有的尾巴卷曲行为
     */
    public void curlTail() {
        System.out.println(name + " " + speciesName + "卷曲其特有的猴子状尾巴");
    }
}
